home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 15
/
Aminet 15 - Nov 1996.iso
/
Aminet
/
disk
/
cdrom
/
SkandalfoCDP.lha
/
SCDPlayer
/
SCDPLyrics.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1996-09-03
|
3KB
|
162 lines
/* First try at giving SCDP a lyrics window via MUIRexx */
/* Definitions */
Text_Contents = 0x8042f8dc
Text_PreParse = 0x8042566d
Font = 0x8042be50
Font_Big = -6
/* End Definitions */
/* Consts */
SLVER="1.0"
VERSTR="$VER: SCDPLyrics 1.0 (30.8.96)"
/* End Consts */
ADDRESS SCDPLYRICS
OPTIONS RESULTS
OPTIONS FAILAT 120
window ID LYRI PORT SCDPLYRICS COMMAND '"SETVAR QUIT QUIT"' TITLE '"SCDPlayer Lyrics 'SLVER' "'
group
text ID LINE ATTRS Text_Contents '""' Text_PreParse '"\033c"' Font Font_Big
endgroup
endwindow
'SETVAR QUIT ""'
LastTrack=0
LastIndex=0
TS=0
TE=360000
Track=0
Ind=0
Running=1
FO=0
DO WHILE Running
'GETVAR QUIT'
IF ~SHOW('P','SCDP') | ~SHOW('P','SCDPLYRICS') | RESULT~='' THEN DO
quit
IF FO THEN
CALL CLOSE('lfile')
EXIT
END
ADDRESS SCDP
STATUS
Stat=RESULT
IF(Stat=STOPPED | Stat=NODISK) THEN DO
Ind=0
Track=0
END
ELSE DO
PLAYINGTRACK
IF RC=0 THEN Track=RESULT
TRACKSTART Track
IF RC=0 THEN TS=RESULT
PLAYINGPOS
IF RC=0 THEN Ind=RESULT-TS
TRACKEND Track
IF RC=0 THEN TE=RESULT
END
ADDRESS SCDPLYRICS
IF Track~=0 & (LastTrack=0 | LastTrack~=Track | Ind<LastIndex) THEN DO /* Empezar lectura */
Next=TE-TS+75
Lyric=''
IF FO THEN
CALL CLOSE('lfile')
ADDRESS SCDP
DISKSPATH
DP=RESULT
IDFILENAME
fname=DP'LY'SUBSTR(RESULT,3)
ADDRESS SCDPLYRICS
IF ~OPEN('lfile',fname,'R') THEN DO
FO=0
text ID LINE ATTRS Text_Contents '"'Lyric'"'
END
ELSE DO
FO=1
l=''
DO WHILE ~EOF('lfile') & l~='#'Track
l=READLN('lfile')
END
IF ~EOF('lfile') THEN DO
Next=-1
Lyric=''
END
ELSE DO
text ID LINE ATTRS Text_Contents '"'Lyric'"'
END
END
END
IF Track=0 THEN DO
Lyric=''
Next=2000
text ID LINE ATTRS Text_Contents '"'Lyric'"'
IF FO THEN DO
CALL CLOSE('lfile')
FO=0
END
END
ELSE DO /* Leer siguiente */
IF FO THEN DO
FL=~EOF('lfile')
END
ELSE DO
FL=0
END
DO WHILE FL & Ind>Next
text ID LINE ATTRS Text_Contents '"'Lyric'"'
l=READLN('lfile')
IF l='' | LEFT(l,1)='#' THEN DO
Next=TE-TS+75
Lyric=''
END
ELSE DO
PARSE VAR l pos Lyric
a=0
b=0
c=0
pa=INDEX(pos,':')
pb=INDEX(pos,'.')
IF pa~=0 THEN DO
a=LEFT(pos,pa-1)
IF pb~=0 THEN DO
b=SUBSTR(pos,pa+1,pb-pa-1)
c=SUBSTR(pos,pb+1)
END
ELSE DO
b=SUBSTR(pos,pa+1)
END
END
Next=a*4500+b*75+(c*15)%2
END
END
END
If Next-Ind>150 THEN DO
ADDRESS COMMAND "Delay <>NIL: 1000"
END
ELSE DO
ti=min(1000,max(0,((Next-Ind)*1000)%75))
ADDRESS COMMAND "Delay <>NIL: "ti
END
LastIndex=Ind
LastTrack=Track
END